<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>乌鲁木齐行政区域图</title>
    <!-- 引入jquery文件 -->
    <script src="../js/jquery-3.1.1.js"></script>
    <!-- 引入 ECharts 文件 -->
    <script src="../js/echarts.js"></script>
</head>
<body>
<div id="map" style="width: 800px;height:600px;"></div>

<script>

    // JS
    var chart = echarts.init(document.getElementById('map'));
    chart.setOption({
        series: [{
            type: 'map',
            map: 'urumqi'
        }]
    });


    // JSON
    $.getJSON('../data/wlmq_block.json', function (data) {
        echarts.registerMap('urumqi', data);
        var chart = echarts.init(document.getElementById('map'));
        chart.setOption({
            title: {
                text: '乌鲁木齐区域人口密度',
                subtext: '人口密度数据来自baidu',
                sublink: 'http://ecomfe.github.io/echarts-map-tool/'
            },
            tooltip: {
                trigger: 'item',
                formatter: '{b}<br/>{c} (p / km2)'
            },
            visualMap: {
                min: 0,
                max: 10000,
                text:['High','Low'],
                realtime: false,
                calculable: true,
                inRange: {
                    color: ['lightskyblue','yellow', 'orangered']
                }
            },
            series: [
                {
                    name: '香港18区人口密度',
                    type: 'map',
                    mapType: 'urumqi', // 自定义扩展图表类型
                    itemStyle:{
                        normal:{label:{show:true}},
                        emphasis:{label:{show:true}}
                    },
                    data:[
                        {name: '沙依巴克区'},
                        {name: 'SYBK_100', value: 6761.27087031978},
                        {name: 'SYBK_101', value: 1548.48176345307},
                        {name: 'SYBK_102', value: 9797.05361622682},
                        {name: 'SYBK_103', value: 1878.94601961692},
                        {name: 'SYBK_104', value: 3197.36703287777},
                        {name: 'SYBK_105', value: 6759.75483273432},
                        {name: 'SYBK_106', value: 4900.46743359868},
                        {name: 'SYBK_107', value: 8645.82081226024},
                        {name: 'SYBK_108', value: 3347.84695381126},
                        {name: 'SYBK_109', value: 4492.24449771506},
                        {name: 'SYBK_11', value: 6632.92050587926},
                        {name: 'SYBK_110', value: 7828.14220717149},
                        {name: 'SYBK_111', value: 5717.1760604941},
                        {name: 'SYBK_112', value: 6390.5098189512},
                        {name: 'SYBK_113', value: 5824.23006050785},
                        {name: 'SYBK_12', value: 4195.99193673504},
                        {name: 'SYBK_13', value: 8001.88409809343},
                        {name: 'SYBK_14', value: 8210.40144487298},
                        {name: 'SYBK_16', value: 5477.86739694483},
                        {name: 'SYBK_17', value: 1827.51043610537},
                        {name: 'SYBK_18', value: 7940.56870870465},
                        {name: 'SYBK_19', value: 2963.06921928658},
                        {name: 'SYBK_2', value: 5453.96518631493},
                        {name: 'SYBK_20', value: 1006.03713580643},
                        {name: 'SYBK_21', value: 4301.49201359917},
                        {name: 'SYBK_23', value: 5482.23499520913},
                        {name: 'SYBK_24', value: 2092.12421906814},
                        {name: 'SYBK_25', value: 7513.31234219095},
                        {name: 'SYBK_26', value: 640.607769538956},
                        {name: 'SYBK_27', value: 5945.43915163699},
                        {name: 'SYBK_29', value: 2757.92349497822},
                        {name: 'SYBK_30', value: 4602.32506815358},
                        {name: 'SYBK_32', value: 251.749206711842},
                        {name: 'SYBK_33', value: 7493.25815742289},
                        {name: 'SYBK_35', value: 9936.61785268826},
                        {name: 'SYBK_36', value: 4497.69056719461},
                        {name: 'SYBK_37', value: 5364.67142507854},
                        {name: 'SYBK_38', value: 8666.56917108251},
                        {name: 'SYBK_4', value: 8048.93260335156},
                        {name: 'SYBK_40', value: 9748.78135615369},
                        {name: 'SYBK_41', value: 1569.65462999284},
                        {name: 'SYBK_42', value: 2699.72927809262},
                        {name: 'SYBK_43', value: 2193.5039620902},
                        {name: 'SYBK_44', value: 484.927432258909},
                        {name: 'SYBK_46', value: 774.735839735231},
                        {name: 'SYBK_47', value: 8259.84674663297},
                        {name: 'SYBK_48', value: 2956.10922368653},
                        {name: 'SYBK_5', value: 8662.54050692176},
                        {name: 'SYBK_50', value: 3202.81146500491},
                        {name: 'SYBK_51', value: 9273.01079328263},
                        {name: 'SYBK_52', value: 5375.92174094987},
                        {name: 'SYBK_53', value: 5218.34228002854},
                        {name: 'SYBK_54', value: 6229.06831378313},
                        {name: 'SYBK_55', value: 1313.20936920477},
                        {name: 'SYBK_56', value: 5307.27912139524},
                        {name: 'SYBK_57', value: 7349.11981853397},
                        {name: 'SYBK_58', value: 8349.93181831481},
                        {name: 'SYBK_59', value: 6977.22135267096},
                        {name: 'SYBK_60', value: 4909.09905530864},
                        {name: 'SYBK_61', value: 1928.43448123807},
                        {name: 'SYBK_62', value: 2933.10460187777},
                        {name: 'SYBK_64', value: 295.470809514623},
                        {name: 'SYBK_67', value: 4932.50323334352},
                        {name: 'SYBK_69', value: 3210.75316375686},
                        {name: 'SYBK_70', value: 8497.86736970083},
                        {name: 'SYBK_71', value: 952.439449911671},
                        {name: 'SYBK_72', value: 2269.86731109484},
                        {name: 'SYBK_73', value: 4800.67390873985},
                        {name: 'SYBK_74', value: 4782.79921370275},
                        {name: 'SYBK_75', value: 2123.91137821876},
                        {name: 'SYBK_76', value: 231.167374163096},
                        {name: 'SYBK_80', value: 3822.81582871188},
                        {name: 'SYBK_82', value: 4524.56412018195},
                        {name: 'SYBK_83', value: 9835.3883533739},
                        {name: 'SYBK_84', value: 800.227983181737},
                        {name: 'SYBK_85', value: 852.809358322635},
                        {name: 'SYBK_86', value: 4277.67646750025},
                        {name: 'SYBK_87', value: 767.567264646473},
                        {name: 'SYBK_88', value: 3222.18666938475},
                        {name: 'SYBK_89', value: 7006.829615206},
                        {name: 'SYBK_90', value: 2427.11816229747},
                        {name: 'SYBK_91', value: 9970.3728362099},
                        {name: 'SYBK_92', value: 2076.79618770726},
                        {name: 'SYBK_93', value: 6353.61635545876},
                        {name: 'SYBK_94', value: 5466.50906387508},
                        {name: 'SYBK_96', value: 7296.02432056497},
                        {name: 'SYBK_98', value: 7914.15231456098},
                        {name: 'SYBK_99', value: 1893.87207385162}

                    ]
                    // 自定义名称映射
                    /*nameMap: {
                        'Central and Western': '中西区',
                        'Eastern': '东区',
                        'Islands': '离岛',
                        'Kowloon City': '九龙城',
                        'Kwai Tsing': '葵青',
                        'Kwun Tong': '观塘',
                        'North': '北区',
                        'Sai Kung': '西贡',
                        'Sha Tin': '沙田',
                        'Sham Shui Po': '深水埗',
                        'Southern': '南区',
                        'Tai Po': '大埔',
                        'Tsuen Wan': '荃湾',
                        'Tuen Mun': '屯门',
                        'Wan Chai': '湾仔',
                        'Wong Tai Sin': '黄大仙',
                        'Yau Tsim Mong': '油尖旺',
                        'Yuen Long': '元朗'
                    }*/
                }
            ]

        });
    });


</script>
</body>
</html>